package com.myproject.utils;

import java.util.*;

public class Test {

    public static void main(String[] args) {
        Boy boy1 = new Boy();
        boy1.setAge(100);
        Map<String,String> data = new HashMap<>();
        data.put("name","xiaoming");
        data.put("address","tokyo");
        boy1.setData(data);

        Girl girl = new Girl();
        girl.setName("鞠婧祎");
        boy1.setGirl(girl);

        System.out.println(boy1);
        Boy boy2 = (Boy) BeanCopy.copy(boy1);
        System.out.println(boy2);
        System.out.println(boy1==boy2);
        System.out.println(boy1.getGirl()==boy2.getGirl());

        //Integer
        /*Integer i1 = 1;
        Integer i2 = new Integer(1);
        System.out.println(i1==i2);
        System.out.println(i1.equals(i2));
        System.out.println(System.identityHashCode(i1));
        System.out.println(System.identityHashCode(i2));*/
        //String
        /*String str1 = "你好";
        String str2 = (String) BeanCopy.copy(str1);
        System.out.println(str1==str2);*/

        //set
        /*Set<String> set1 = new HashSet<>();
        set1.add("爱");
        set1.add("我");
        set1.add("中");
        Set<String> set2 = (Set<String>) BeanCopy.copy(set1);
        System.out.println(set1);
        System.out.println(set2);
        System.out.println(set1==set2);*/


        //map测试
        /*Map<String,String> map1 = new HashMap<>();
        map1.put("name","小米");
        map1.put("address","上海");
        Map<String,String> map2 = (Map<String, String>) BeanCopy.copy(map1);
        System.out.println(map1);
        System.out.println(map2);
        System.out.println(map1==map2);*/

        //list测试
        /*List<String> list = new ArrayList<>();
        list.addAll(Arrays.asList("爱","我","中","华"));
        System.out.println(list.getClass());
        List list1 = (List) BeanCopy.copy(list);
        System.out.println(list);
        System.out.println(list1);
        System.out.println(list==list1);*/
    }


}
